<template>
  <div class="orderDetail">
    <Header left="arrow" title="订单详情"></Header>
    <div class="stateCard">
      <div class="state">订单已取消</div>
      <div class="desc">欢迎您对本店的支持，欢迎再次光临</div>
      <div class="btn">再来一单</div>
    </div>
    <OrderCard :currentOrder="orderDetail"></OrderCard>
    <!-- 客服 -->
    <div class="service">
      <div class="icon"><van-icon name="service" /></div>
      <span>客服</span>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Icon } from "vant";

Vue.use(Icon);
import Header from "@/components/Header";
import OrderCard from "@/components/order/OrderCard";
export default {
  name: "orderDetail",
  components: {
    Header,
    OrderCard,
  },
  data() {
    return {
      orderDetail: {
        
      },
    };
  },
  beforeRouteEnter(to, from, next) {
    // console.log("beforeRouteEnter",to.params.order)
    console.log("to",to)
    console.log("from",from)
    next(vm => {
      vm.orderDetail = to.params.order;
    });
  },
  methods: {},
};
</script>

<style scoped>
.orderDetail {
  padding-top: 2.13rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f6f6f6;
}
.stateCard {
  min-height: 3rem;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  margin: 0.3rem 0.5rem 0 0.5rem;
  border-radius: 10px;
}
.stateCard .state {
  font-size: 18px;
  margin: 0.5rem 0 0.15rem 0;
}
.stateCard .desc {
  font-size: 14px;
  color: grey;
  margin-bottom: 0.2rem;
}
.stateCard .btn {
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
  margin-left: 3.3rem;
  border-radius: 2px;
  width: 2.4rem;
  height: 0.8rem;
  text-align: center;
  line-height: 0.8rem;
  border: 1px solid #dba871;
  color: #dba871;
  font-size: 14px;
}
.service {
  position: fixed;
  top: 2.7rem;
  right: 0.5rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  box-shadow: 0px 0px 5px #d1d1d1;
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
}
.service .icon {
  font-size: 22px;
  width: 100%;
}
.service span {
  font-size: 11px;
}
</style>